#include "BoxSectionNumericalCalculator.h"
#include "DataStructure/Common/Real.h"
#include "Box1SectionNumericalCalculator.h"
#include "SectionCalculator/StandardSectionTool.h"

using SG::DataStructure::Common::Real;
using SG::DataStructure::FEM::PBARLData;
using SG::FEMSolver::Element::BoxSectionNumericalCalculator;
using SG::FEMSolver::Element::Box1SectionNumericalCalculator;

void BoxSectionNumericalCalculator::Mesh (const PBARLData& section, _OUT Meshes& meshes, int refineLevel) const
{
    /* NASTRAN 的 BOX 形梁截面转换成 BOX1 形梁截面
     * 
     * box1.dim1 = box.dim1
     * box1.dim2 = box.dim2
     * box1.dim3 = box.dim3
     * box1.dim4 = box.dim3
     * box1.dim5 = box.dim4
     * box1.dim6 = box.dim4
     * 详细请参考 NASTRAN 手册
     */
    Real dim1{section.m_dimension[0]};
    Real dim2{section.m_dimension[1]};
    Real dim3{section.m_dimension[2]};
    Real dim4{dim3};
    Real dim5{section.m_dimension[3]};
    Real dim6{dim5};
    PBARLData box1Section{section};
    box1Section.m_dimension = {dim1, dim2, dim3, dim4, dim5, dim6};
    Box1SectionNumericalCalculator BoxSecMesher;
    BoxSecMesher.Mesh (box1Section, _OUT meshes, refineLevel);
}